﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserOrder.aspx.cs" Inherits="Maticsoft.Web.UserOrder" %>

<%@ Register Src="Header2.ascx" TagName="Header2" TagPrefix="uc1" %>
<%@ Register Src="footer.ascx" TagName="footer" TagPrefix="uc2" %>
<%@ Register Src="UserLeft.ascx" TagName="UserLeft" TagPrefix="uc3" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>会员中心</title>
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/common.css" />
    <style type="text/css">
        .pages
        {
            color: #999;
            overflow: auto;
        }
        .pages a, .pages .cpb
        {
            text-decoration: none;
            float: left;
            padding: 8px;
            border: 1px solid #ddd;
            background: #ffff;
            margin: 0 2px;
            font-size: 11px;
            color: #000;
        }
        .pages a:hover
        {
            background-color: #E61636;
            color: #fff;
            border: 1px solid #E61636;
            text-decoration: none;
        }
        .pages .cpb
        {
            font-weight: bold;
            color: #fff;
            background: #E61636;
            border: 1px solid #E61636;
        }
    </style>
    <script type="text/javascript" src="js/jquery-1.8.2.js"></script>
    <script type="text/javascript">
        function Confirm(obj) {
            $.ajax({
                type: "get",
                url: "UserOrder.aspx",
                data: "op=confirm&orderId=" + obj + "&d=" + new Date().toString(),
                success: function (data) {
                    if (data == "1") {
                        window.location.reload();
                    }
                }
            })
        }

        function Pay(obj) {
            $.ajax({
                type: "get",
                data: "op=pay&orderid=" + obj + "&d=" + new Date(),
                url: "userorder.aspx",
                success: function (msg) {
                    var n = eval('(' + msg + ')');
                    if (n.code == "1") {
                        window.open("/pay/alipay/default.aspx?orderid=" + n.data.orderid + "&fee=" + n.data.fee + "&name=" + escape("购买商品") + "&remark=");
                    }
                },
                error: function () {

                }
            })
           
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <uc1:Header2 ID="Header21" runat="server" />
    <div class="row bg-gray" style="padding: 20px 0;">
        <div class="safe_width">
            <uc3:UserLeft ID="UserLeft1" runat="server" />
            <div class="right-cont">
                <div class="men-cen-tit">
                    <a <%=(Request.QueryString["status"]=="0" || string.IsNullOrEmpty(Request.QueryString["status"])) ? "class=\"active\"" : "" %>
                        href="UserOrder.aspx?status=0">全部订单</a> <a href="UserOrder.aspx?status=1" <%=Request.QueryString["status"]=="1" ? "class=\"active\"" : "" %>>
                            未支付订单 </a><a href="UserOrder.aspx?status=2" <%=Request.QueryString["status"]=="2" ? "class=\"active\"" : "" %>>
                                待收货订单</a>
                </div>
                <div class="row" style="padding: 20px 10px; line-height: 24px; box-sizing: border-box;">
                    <div class="equal-3 fl tl">
                        <div class="equal-2 fl fs-12 tc tc-black" style="width: 48%;">
                            商品</div>
                        <div class="equal-2 fl">
                            <div class="equal-1-3 fs-12 tc-black fl tc">
                                单价(元)</div>
                            <div class="equal-1-3 fs-12 tc-black fl tc">
                                数量</div>
                            <div class="equal-1-3 fs-12 tc-black fl tc">
                                </div>
                        </div>
                    </div>
                    <div class="equal-1 fl">
                        <div class="equal-1-3 fs-12 tc-black fl tc">
                            实付款(元)</div>
                        <div class="equal-1-3 fs-12 tc-black fl tc">
                            交易状态</div>
                        <div class="equal-1-3 fs-12 tc-black fl tc">
                            交易操作</div>
                    </div>
                </div>
                <asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                <div class="borderbox">
                    <div class="bordertop fs-12 tc-gray">
                        <p class=" fs-12">
                            <%#Convert.ToDateTime(Eval("CreateTime")).ToString("yyyy-MM-dd HH:mm:ss") %> 订单号：<span class="tc-black"><%#Eval("OrderNo") %></span> 支付方式：在线支付</p>
                    </div>
                    <div class="row shop-car-indent">
                        <div class="equal-3 fl">
                            <%#GetOitem(int.Parse(Eval("OrderId").ToString())) %>
                        </div>
                        <div class="equal-1 fl">
                            <div class="equal-1-3 fs-14 fb tc-black fl tc line-hei-20" style="<%#GetHeight(int.Parse(Eval("OrderId").ToString())) %>border-right: 1px solid #e6e6e6;">
                                <%#Eval("Total") %><%#Maticsoft.Common.DigitHelper.GetDecimal(Eval("DeliveryFee")) > 0 ? "<br /><font style='font-size:12px; font-weight:normal'>含" + Eval("DeliveryFee") + "运费</font>" : ""%></div>
                            <div class="equal-1-3 fl tc line-hei-20" style="<%#GetHeight(int.Parse(Eval("OrderId").ToString())) %>border-right: 1px solid #e6e6e6;">
                                <a class="fs-12 tc-gray line-hei-20"><%#Eval("OrderStatusName")%></a><br /> <a class="fs-12 tc-gray line-hei-20" href="UserOrderDetail.aspx?orderId=<%#Eval("OrderId") %>">
                                    订单详情</a>
                            </div>
                            <div class="equal-1-3 fs-12 tc-gray fr tc line-hei-20" style="width: 32%;">
                                <%#GetOperation(int.Parse(Eval("OrderId").ToString()),int.Parse(Eval("Status").ToString())) %></div>
                        </div>
                    </div>
                </div>
                </ItemTemplate>
                </asp:Repeater>
                <div class="page-no" style="padding: 30px 0;">
                    <webdiyer:AspNetPager ID="AspNetPager1" CssClass="pages" CurrentPageButtonClass="cpb"
                        runat="server" UrlPaging="true" HorizontalAlign="center" PageSize="10" EnableTheming="true"
                        OnPageChanging="AspNetPager1_PageChanging">
                    </webdiyer:AspNetPager>
                </div>
            </div>
        </div>
    </div>
    <uc2:footer ID="footer1" runat="server" />
    </form>
</body>
</html>
